/*
 * @Description: 
 * @Author: charles
 * @Date: 2021-11-19 11:12:42
 * @LastEditors: charles
 * @LastEditTime: 2021-11-19 11:19:25
 */
class Person {
  name:string = 'terry';
  protected age:number = 12;
  private weight:number = 120;

  sayName(){
    console.log('my name is',this.name);
  }
  sayAge(){
    console.log('my age is',this.age);
  }
  sayWeight(){
    console.log('my weight is',this.weight - 30,'kg');
  }
}
let p = new Person();
p.sayAge();
p.sayName();
p.sayWeight();

class Student extends Person{
  sayNameAge(){
    console.log(this.name);
    console.log(this.age);
  }
}

export default Person;